/*
 * c7_exercise3.cpp
 *
 *  Created on: Sep 2, 2013
 *      Author: cyper.yin
 */

#include <iostream>
using namespace std;

struct box {
	char maker[40];
	float height;
	float width;
	float length;
	float volume;
};
void display_box(box b);
void set_volume(box * p);
int main_c7e3(int argc, char **argv) {
	box b = { "Made in China", 12, 12, 0.1, 0 };

	set_volume(&b);

	display_box(b);

	return 0;
}
void display_box(box b) {
	cout << "box:" << endl;
	cout << "maker=" << b.maker << endl;
	cout << "height=" << b.height << endl;
	cout << "width=" << b.width << endl;
	cout << "length=" << b.length << endl;
	cout << "volume=" << b.volume << endl;
}
void set_volume(box * p) {
	p->volume = p->height * p->width * p->length;
}

